<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/common.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"

                xmlns:p="http://primefaces.org/ui">

    <ui:define name="title">
        Event List
    </ui:define>

    <ui:define name="pageheader">
         <script>
            $(function() {
                $(document).tooltip();
            });
        </script>
        <style>
            label {
                display: inline-block;
                width: 100px;
            }
        </style>
          <link rel="stylesheet" href="../../res/css/admin-style.css"/>
    </ui:define>
    <ui:define name="content">
        <h:form id="mainform">


            <h:dataTable value="#{eventManager.allEvent}" var="e"
                           styleClass="order-table"
    			headerClass="order-table-header"
    			rowClasses="order-table-odd-row,order-table-even-row">
               
                <h:column>
                    <f:facet name="header">
                        <h:commandLink value="Title" />
                    </f:facet>
                    #{e.title}
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:commandLink value="Start time" />
                    </f:facet>
                    <h:outputText value="#{e.startTime}">
                        <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+7"/>
                    </h:outputText>
                </h:column>


                <h:column>
                    <f:facet name="header">
                        <h:commandLink value="End time" />
                    </f:facet>
                    <h:outputText value="#{e.endTime}">
                        <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+7"/>
                    </h:outputText>
                </h:column>
               
                <h:column>
                    <f:facet name="header">
                        <h:commandLink value="Options" />
                    </f:facet>
                    <h:commandLink action="#{eventManager.edit(e)}" class="icon-1 info-tooltip" title="Edit" />
                    <h:commandLink title="Delete" action="#{eventManager.remove(e)}" class="icon-2 info-tooltip"  />
                    <h:commandLink title="Edit1" action="#{eventManager.edit(e)}" class="icon-3 info-tooltip"/>
                    <!--                    <h:commandLink title="Edit" class="icon-4 info-tooltip" />
                                        <h:commandLink title="Edit" class="icon-5 info-tooltip" />-->
                </h:column>
            </h:dataTable>
            <h:commandButton value="Add" action="create" />
        </h:form>
    </ui:define>
</ui:composition>
